/*

This file is part of Zephyr.

    Zephyr is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Zephyr is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Zephyr.  If not, see <http://www.gnu.org/licenses/>.

*/

#include <QFile>
#include <QTextStream>
#include "createnewconnection.h"
#include "ui_createnewconnection.h"

bool connection = false;

createNewConnection::createNewConnection(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::createNewConnection)
{
    ui->setupUi(this);
    connect(ui->connectButton, SIGNAL(pressed()), this, SLOT(on_connectButton_clicked()));
}

createNewConnection::~createNewConnection()
{
    delete ui;
}

void createNewConnection::on_cancelButton_clicked()
{
    this->close(); //close this window dialog when cancel button pressed
}


void createNewConnection::on_connectButton_clicked()
{
     this->hide();
     emit connectClicked(ui->userNameEntry->text(), ui->passwordEntry->text(), ui->serverNameEntry->text(), ui->portNumberEntry->text(), ui->saveConnectionButton->isChecked());
}
